# -*- coding: utf-8 -*-
"""
@Time    : 2025/2/27 19:35 
@Author  : ZhangShenao 
@File    : main.py 
@Desc    : 主函数
"""
from apply import similarity_search
from data_process import pre_process
from train import train_word2vec

if __name__ == '__main__':
    # 数据预处理
    corpus = pre_process(xml_path="./weibo_content_corpus.xml")

    # 训练模型
    train_word2vec(sentences=corpus)

    # 使用模型进行相似度检索
    similarity_words = similarity_search(query="明星", top_n=3)
    print(f"相似度检索结果: \n{similarity_words}")
